package org.eiahe.hr.salary.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.ehe.common.core.validate.AddGroup;
import org.ehe.common.core.validate.EditGroup;
import org.ehe.common.core.xss.Xss;
import org.ehe.common.mybatis.core.domain.BaseEntity;
import org.eiahe.hr.salary.domain.BonusCalculation;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 奖金核算业务对象
 *
 * @author zhangnn
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BonusCalculation.class, reverseConvertGenerate = false)
public class BonusCalculationBo extends BaseEntity {

    /**
     * 核算ID
     */
    @NotNull(message = "核算ID不能为空", groups = { EditGroup.class })
    private Long calculationId;

    /**
     * 租户ID
     */
    private String tenantId;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeNo;

    /**
     * 员工姓名
     */
    @NotBlank(message = "员工姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String employeeName;

    /**
     * 奖金类型
     */
    @NotBlank(message = "奖金类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String bonusType;

    /**
     * 奖金金额
     */
    @NotNull(message = "奖金金额不能为空", groups = { AddGroup.class, EditGroup.class })
    private BigDecimal bonusAmount;

    /**
     * 核算规则
     */
    @Xss(message = "核算规则不能包含脚本字符")
    private String calculationRule;

    /**
     * 核算人
     */
    private String calculator;

    /**
     * 核算时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date calculationTime;

    /**
     * 核算状态(0待审核 1已审核 2已发放)
     */
    private String calculationStatus;

    /**
     * 审核人
     */
    private String auditor;

    /**
     * 审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    /**
     * 备注
     */
    @Xss(message = "备注不能包含脚本字符")
    private String remark;
}